//
//  XLHostApplyButtonCell.m
//  XiangLove
//
//  Created by 李传坤 on 2018/7/23.
//  Copyright © 2018年 BAOMIHUA.COM. All rights reserved.
//

#import "XLHostApplyButtonCell.h"

@implementation XLHostApplyButtonCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self addheaderView];
    }
    return self;
}
- (void)addheaderView {
    
    self.applyButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.applyButton.layer.cornerRadius = 5;
    self.applyButton.backgroundColor = RGB_HEX(0xffbb01);
    [self.applyButton setTitleColor:kWhiteColor forState:UIControlStateNormal];
    [self.applyButton setTitle:@"提交" forState:UIControlStateNormal];
    [self.applyButton addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:_applyButton];
    [self.applyButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView.mas_top).offset(15);
        make.left.equalTo(self.contentView.mas_left).offset(15);
        make.right.equalTo(self.contentView.mas_right).offset(-15);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-35);
    }];
  
    self.Inforlabel = [[UILabel alloc] init];
    self.Inforlabel.textColor = [UIColor lightGrayColor];
    _Inforlabel.font = [UIFont systemFontOfSize:12.0f];
    _Inforlabel.text = @"照片内容必须清晰,如果信息不真实将不会通过审核";
    _Inforlabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_Inforlabel];
    [_Inforlabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.applyButton.mas_bottom).offset(10);
        make.left.equalTo(self.contentView.mas_left);
        make.right.equalTo(self.contentView.mas_right);
    }];

    
}
- (void)clickButton:(UIButton *)button{
    if ([_delagate respondsToSelector:@selector(uploadApplyInforButton)]) {
        [_delagate uploadApplyInforButton];
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
